package com.metacube.metaconnect.Service;

import java.sql.Date;
import java.sql.SQLException;
import java.util.ArrayList;

import com.metacube.metaconnect.model.FileUpdate;
import com.metacube.metaconnect.model.SignUpStep1Form;
import com.metacube.metaconnect.model.SignUpStep2Form;
import com.metacube.metaconnect.model.UpdateProfileForm;
import com.metacube.metaconnect.model.UserInformationDAO;

public class UserInformationService {
	private UserInformationDAO userDAO;

	public UserInformationService() {
		userDAO = new UserInformationDAO();
	}

	public boolean insertUserInfoStep1(SignUpStep1Form form) {
		return userDAO.insertUserInfoStep1(form);
	}

	public boolean updateFile(FileUpdate update, String imgName, String email) {
		return userDAO.updateFile(update, imgName, email);
	}

	public boolean insertUserInfoStep2(SignUpStep2Form objUserTemplate,
			String email, Date dob, String imgName) {
		return userDAO
				.insertUserInfoStep2(objUserTemplate, email, dob, imgName);
	}

	public boolean alreadyActivate(String email) throws SQLException {
		return userDAO.alreadyActivate(email);
	}

	public boolean login(String email, String password) throws SQLException {
		return userDAO.login(email, password);
	}

	public String getActiveUserPassword(String email) throws SQLException {
		return userDAO.getActiveUserPassword(email);
	}

	public ArrayList getuserInfo(String email) {
		return userDAO.getuserInfo(email);
	}

	public boolean Update(UpdateProfileForm form, String date_of_birth) {
		return userDAO.Update(form, date_of_birth);
	}

	public ArrayList<String> searchUser(String name) {
		return userDAO.searchUser(name);
	}
	public String getProfilePicUrl(String email){
		return userDAO.getProfilePicUrl(email);
	}
	public boolean check(int activationCode) {
		return userDAO.check(activationCode);
	}

	public boolean insertInactiveUserDetails(String emailId, int activationCode) {
		return userDAO.insertInactiveUserDetails(emailId, activationCode);
	}

	public String getEmailId(int activationCode) {
		return userDAO.getEmailId(activationCode);
	}

	public ArrayList fetchDetails(String email) {
		return userDAO.fetchDetails(email);
	}
}
